<div class="container">
  <div nz-row nzType="flex" nzJustify="start">
    <button nz-button style="margin-bottom: 4px;" nzSize='large' routerLink="/admin/add" nzType="primary">添加博客</button>
  </div>
  <ul
    nz-list
    [nzDataSource]="arts"
    nzBordered
    nzSize="large"
    [nzHeader]="'管理列表'"
    [nzFooter]="'博客列表'"
    [nzRenderItem]="largeItem"
    [nzPagination]="pagination"
  >
    <ng-template #largeItem let-item>
      <li nz-list-item [nzActions]="[opAction,onTopAction,deAction]" [nzContent]="item.title" nzNoFlex></li>
      <ng-template #opAction><a [routerLink]="['/admin/edit',item.id]">编辑</a></ng-template>
      <ng-template #onTopAction><a *ngIf="item.type==1;else top" (click)="ChangeBlogType(item.id,0)">取消</a></ng-template>
      <ng-template #top><a style="color:orchid" (click)="ChangeBlogType(item.id,1)">置顶</a></ng-template>
      <ng-template #deAction><a style="color: red;" *ngIf="item.status==1||item.status==0;else changeAction" (click)="ChangeBlogStatus(item.id,-1)">删除</a></ng-template>
      <ng-template #changeAction><a style="color:green;" *ngIf="item.status==-1" (click)="ChangeBlogStatus(item.id,0)">恢复</a></ng-template>
    </ng-template>
    <ng-template #pagination>
      <nz-pagination 
      [nzPageIndex]="pageIndex" 
      [nzTotal]="total" 
      (nzPageSizeChange)="PageSize($event)" 
      (nzPageIndexChange)="changePageIndex($event)" 
      [nzPageSizeOptions]="[5, 10, 15, 20]" 
      nzShowSizeChanger 
      [nzPageSize]="pageSize"></nz-pagination>
</ng-template>
  </ul>
</div>
    